package lesson2.pages;

import lesson2.api.ApplicationManager;
import lesson2.api.models.UserData;

import org.openqa.selenium.By;

public class IndexPage extends PageBase
{
	public IndexPage(ApplicationManager p_app)
	{
		super(p_app);
	}

	public void fillLoginData(UserData p_userData)
	{
		// Login to site
		type(By.id("username"), p_userData.login);
		type(By.id("password"), p_userData.password);
	}

	public void submitLoginData()
	{
		// Submit login data
		click(By.name("login"));
	}

	public void openRegistrationPage()
	{
		// Open the registration page
		click(By.cssSelector("a.register"));
	}
}
